<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;
use lvzmen\yii\cms\assets\markdown\GithubAsset;

AppAsset::register($this);
//GithubAsset::register($this);

$this->beginPage() ?>


<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php $this->registerCsrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <style>

        .footer {
            /*position: fixed;*/
            bottom: 0;
            background-color: white;
            width: 100%;
            height: 40px;
            z-index: 1031;
        }

    </style>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <!--    //top nav-->
    <?= \lvzmen\yii\cms\widgets\navs\Nav::widget([
        "brandImage" => "/images/logo.png",
        "rightNavs" => [
            ['label' => 'Home', 'url' => ['/yii2/home']],
            ['label' => 'Bootstrap3', 'url' => ['/yii2/bootstrap3']],
        ]
    ])?>

    <!--    //left sidebar-->
    <?= \lvzmen\yii\cms\widgets\sidebar\Sidebar::widget([
        "nodes" => [
            ["name" => "概述", "open" => true, "page" => "overview", "active" => true],
            ["name" => "Form", "open" => true, "page" => "form", "children" => [
                ["name" => "Input", "page" => "form-input", "open" => false],
                ["name" => "Textarea", "page" => "form-textarea", "open" => false],
            ]],
            ["name" => "Button", "open" => false, "children" => [
                ["name" => "Button", "page" => "button", "open" => false],
                ["name" => "Group", "page" => "button-group", "open" => false],
                ["name" => "Dropdown", "page" => "button-dropdown", "open" => false]
            ]],
            ["name" => "Alert", "open" => true, "page" => "alert", "active" => false],
            ["name" => "Carousel", "open" => true, "page" => "carousel", "active" => false],
//            ["name" => "Collapse", "open" => true, "page" => "collapse", "active" => true],
            ["name" => "Dropdown", "open" => true, "page" => "dropdown", "active" => false],
            ["name" => "Modal", "open" => true, "page" => "modal", "active" => false],
            ["name" => "Nav", "open" => true, "page" => "nav", "active" => false],
            ["name" => "NavBar", "open" => true, "page" => "nav-bar", "active" => false],
            ["name" => "Progress", "open" => true, "page" => "progress", "active" => false],
            ["name" => "Tabs", "open" => true, "page" => "tabs", "active" => false],
            //["name" => "ToggleButtonGroup", "open" => true, "page" => "toggle-button-group", "active" => false],
//            ["name" => "Botton", "open" => false, "children" => [
//                ["name" => "Button Group", "open" => false]
//            ]],
//            ["name" => "Botton", "open" => false, "children" => [
//                ["name" => "Button Group", "open" => false]
//            ]],
//            ["name" => "Botton", "open" => false, "children" => [
//                ["name" => "Button Group", "open" => false]
//            ]],
        ],
        "onclick" => <<<JS
            $.ajax({
                type: "POST",
                url: "/yii2/bootstrap3",
                data: {page: treeNode.page},
                dataType: "text",
                success: function(res){
                    $(".cms-article").html(res);
                    //hljs.highlightAll();
                    createCatalogue();
                }
            });
JS
    ])?>


    <div class="cms-article">
        <?=$article?>
    </div>

    <!--    anchor bar-->

    <?= \lvzmen\yii\cms\widgets\navs\Anchor::widget([])?>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?></p>

        <p class="pull-right"><?= Yii::powered() ?></p>
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

